<template>
  <div>
    <table border="1" @resize="a">
      <thead>
        <tr>
          <th v-for="(col,index) in cols" :key="index">{{col.title}}</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(row,lineIndex) in aa" :key="lineIndex">
          <td v-for="(col,colIndex) in cols" :key="colIndex">{{row[col.key]}}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script>
export default {
  name: "project",
  data() {
    return {
      cols: [
        {
          title: "姓名",
          key: "name"
        },
        {
          title: "发表",
          key: "say"
        }
      ],
      aa: [
        { name: "Liuyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" },
        { name: "Liyan", say: "hi" }
      ]
    };
  },
  methods:{
    a(){
      console.log(111);
    }
  }
};
</script>
<style lang="scss">
@import "./index";
</style>